home *** CD-ROM | disk | FTP | other *** search
- ; Installationsscript for qmail
- ; Global variables begin with '#'
- ; Local variables begin with '_'
-
- ; Set up localised strings.
- (procedure P_doLocaleStrings
- (if (= @language "dansk")
- (
- (set #askInPlace "Skal der installeres uden kopiering?")
- (set #askInPlaceHelp (cat
- "Det er muligt at installere " @app-name " i den skuffe "
- "installationsfilerne ligger i. Dette betyder at "
- "der ikke skal kopieres filer under installationen."
- ))
- (set #askDestDir (cat
- "Hvor skal " @app-name " installeres?"
- ))
- (set #askDestDirHelp (cat
- "Der vil ikke blive oprettet en ny skuffe til "
- @app-name " i den skuffe du vælger.\n\n"
- ))
- (set #msgDNSsearch "Leder efter DNS servere.")
- (set #msgDNSlookup "Foretager opslag i DNS.")
- (set #msgWritingControls "Skriver kontrolfiler.")
- (set #msgCreatingDirs "Opretter skuffer.")
- (set #msgCreatingUsers "Opretter brugere og grupper.")
- (set #msgMiamiDatabase (cat "Det er nødvendigt at oprette nogle "
- "brugere og grupper for at " @app-name " kan fungere. Dette "
- "kan desværre ikke gøres automatisk i Miami. Du skal derfor "
- "flette ASCII filen \"%s\" ind i Miamis brugerdatabase og flette "
- "ASCII filen \"%s\" i Miamis gruppedatabase (hvordan dette gøres "
- "er beskrevet i brugervejledningen til Miami. Vælg \"Fortsætte\" "
- "når du er færdig med dette."
- ))
- (set #askUserStartup (cat "Skal " @app-name " startes automatisk når "
- "Amiga'en startes op?"
- ))
- (set #askStartNow (cat "Ønsker du at starte " @app-name " nu?"))
- )
- ;else
- (
- (set #askInPlace "Install in-place without copying?")
- (set #askInPlaceHelp (cat
- "It is possible to install " @app-name " in the drawer "
- "containing the installation files. This means "
- "that copying files during installations isn't "
- "necessary."
- ))
- (set #askDestDir (cat
- "Where do you want to install " @app-name "?"
- ))
- (set #askDestDirHelp (cat
- "A new drawer for " @app-name " will not be created"
- "in the drawer you choose.\n\n"
- ))
- (set #msgDNSsearch "Searching for DNS servers.")
- (set #msgDNSlookup "Performing DNS lookups.")
- (set #msgWritingControls "Writing control files.")
- (set #msgCreatingDirs "Creating drawers.")
- (set #msgCreatingUsers "Creating users and groups.")
- (set #msgMiamiDatabase (cat "It is necessary to create some users "
- "and gruops for " @app-name " to work. Unfortunately, it is not "
- "possible to do this automatically with Miami. You will have to "
- "do this by merging the ASCII file \"%s\" with Miami's user "
- "database and merge the ASCII file \"%s\" with Miami's group "
- "database (the Miami user manual describes how to do this). "
- "Choose \"Proceed\" when you have completed this task."
- ))
- (set #askUserStartup (cat "Do you want " @app-name " to be started "
- "automatically when your Amiga boots up?"
- ))
- (set #askStartNow (cat "Do you want to start " @app-name " now?"))
- ))
- )
-
- ; Return the position of the character _chr in the string _str,
- ; searching from the beginning of the string. Returns the length of _str
- ; if _chr is not found.
- (procedure P_strchr _str _chr
- (
- (set _i 0)
- (set _length (strlen _str))
- (while (AND (< _i _length) (<> (substr _str _i 1) _chr))
- (set _i (+ _i 1))
- )
- _i
- ))
-
- ; Return the position of the character _chr in the string _str,
- ; searching from the end of the string. Returns -1 if _chr is not found.
- (procedure P_strrchr _str _chr
- (
- (set _i (- (strlen _str) 1))
- (while (AND (=> _i 0) (<> (substr _str _i 1) _chr))
- (set _i (- _i 1))
- )
- _i
- ))
-
- ; Run an external command and return the output from stdout in #output.
- (procedure P_run _command
- (
- (set _temp (run (cat _command " >ENV:InstallScriptTemp") (safe)))
- (set #output (getenv "InstallScriptTemp"))
- (delete "ENV:InstallScriptTemp" (safe))
- _temp
- ))
-
- ; Create an icon of the specified type for the specified file
- (procedure P_makeicon _type _file
- (copyfiles
- (source (cat "icons/" _type ".info"))
- (dest (pathonly _file))
- (newname (cat (fileonly _file) ".info"))
- (nogauge)
- )
- )
-
- ; Try to guess which TCP/IP stack (if any) is used.
- (procedure P_guessTCPstack
- (if (= 1 (run "SYS:RexxC/RX \"exit SHOW(PORTS,\'AMITCP\')\"" (safe)))
- "AmiTCP/IP"
-
- (if (= 1 (run "SYS:RexxC/RX \"exit SHOW(PORTS,\'MIAMI.1\')\"" (safe)))
- "Miami"
-
- (if (< 0 (getversion ("socket.library" (resident))))
- "INET225"
-
- "None"
- ) ; if
- ) ; if
- ) ; if
- ) ; procedure P_guessTCPstack
-
- ; Piece together a host name from environment variables.
- (procedure P_gethostnamevars
- (
- (set _hostname (getenv "HOSTNAME"))
- (if (NOT _hostname)
- (set _hostname (getenv "HOST"))
- )
- ; Check for a domain part
- (if (NOT (patmatch "#?.#?" _hostname))
- (cat _hostname "." (getenv "DOMAIN"))
- ; else
- _hostname
- )
- ))
-
- ; Try to find the host name.
- (procedure P_gethostname
- (if (= #TCPstack "None")
- (P_gethostnamevars)
- ;else
- (if (= 0 (P_run "bin/hostname"))
- (substr #output 0 (- (strlen #output) 1))
- ;else
- (P_gethostnamevars)
- )
- )
- )
-
- ; Guess where to install qmail.
- (procedure P_guessDestDir
- (if (= #TCPstack "AmiTCP/IP")
- (if (exists "AmiTCP:" (noreq))
- "AmiTCP:qmail"
- (tackon @default-dest "qmail")
- )
-
- (if (= #TCPstack "Miami")
- (if (exists "Miami:" (noreq))
- "Miami:qmail"
- (tackon @default-dest "qmail")
- )
-
- (if (= #TCPstack "INET225")
- (if (exists "Inet:" (noreq))
- "Inet:qmail"
- (tackon @default-dest "qmail")
- )
-
- ; No TCP/IP stack.
- (tackon @default-dest "qmail")
-
- )))
- )
-
- ; Kort pause.
- (procedure P_delay _n
- (set _c 0)
- (while (< _c _n)
- (set _c (+ _c 1))
- )
- )
-
- ; Sej intro ;-)
- (procedure P_coolIntro
- (working "\n\n\n\n\n\n\n\n\n\n\n\n qmail ") (P_delay 50)
- (working "\n\n\n\n\n\n\n\n\n\n\n qmail ") (P_delay 50)
- (working "\n\n\n\n\n\n\n\n\n\n qmail ") (P_delay 50)
- (working "\n\n\n\n\n\n\n\n\n qmail ") (P_delay 60)
- (working "\n\n\n\n\n\n\n\n qmail ") (P_delay 60)
- (working "\n\n\n\n\n\n\n qmail ") (P_delay 70)
- (working "\n\n\n\n\n\n qmail ") (P_delay 80)
- (working "\n\n\n\n\n qmail ") (P_delay 90)
- (working "\n\n\n\n qmail ") (P_delay 110)
- (working "\n\n\n qmail ") (P_delay 130)
- (working "\n\n qmail ") (P_delay 160)
-
- (working "\n\nAmiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 20)
- (working "\n\n Amigaqmail ") (P_delay 20)
- (working "\n\n Amiga qmail ") (P_delay 40)
- (working "\n\n Amiga qmail ") (P_delay 60)
- (working "\n\n Amiga qmail ") (P_delay 90)
- (working "\n\n Amiga qmail ") (P_delay 120)
- (working "\n\n Amiga qmail ") (P_delay 160)
- (message "\n\n\n\nAmiga qmail\n\nversion 1.01")
- )
-
- ; Ask user about in-place installation.
- (procedure P_askInPlace
- ; (if (> @user-level 0)
- (askbool
- (prompt #askInPlace)
- (help (cat #askInPlaceHelp @askbool-help))
- (default 0)
- )
- ;else
- ; 0
- ; )
- )
-
- ; Prompt user for directory to install into.
- (procedure P_askDestDir
- (if (> @user-level 0)
- (askdir
- (prompt #askDestDir)
- (help (cat #askDestDirHelp @askdir-help))
- (default @default-dest)
- (newpath)
- ;(assigns)
- )
- ;else
- @default-dest
- )
- )
-
- ; Find the fully qualified name of the host.
- (procedure P_fqhostname _hostname
- (if (= 0 (P_run (cat "bin/dnsfq " _hostname)))
- (substr #output 0 (- (strlen #output) 1))
- ;else
- _hostname
- )
- )
-
- ; Return the "domain" part of a string (everything after the first '.').
- (procedure P_getdomain _hostname
- (substr _hostname (+ (P_strchr _hostname ".") 1))
- )
-
- ; Return an LF separated list of local IP numbers
- (procedure P_getlocalIPs
- (if (= 0 (P_run "bin/ipmeprint"))
- (substr #output 0 (- (strlen #output) 1))
- ;else
- ; FIXME Could try "dnsip hostname" also
- "127.0.0.1"
- )
- )
-
- ; Convert a LF separated list of local IP numbers to a LF separated list
- ; of hostnames, and include the host name given.
- (procedure P_getlocals _localIPs _hostname
- (
- (set _locals _hostname)
- (set _end (P_strchr _localIPs "\n"))
- (while (<> 0 _end)
- (
- (set _IP (substr _localIPs 0 _end))
- (if (= 0 (P_run (cat "bin/dnsptr " _IP)))
- (
- (set #output (substr #output 0 (- (strlen #output) 1)))
- (if (<> #output _hostname)
- (set _locals (cat _locals "\n" #output))
- )
- ))
- (set _localIPs (substr _localIPs (+ _end 1)))
- (set _end (P_strchr _localIPs "\n"))
- ))
- _locals
- ))
-
- ; Convert a LF separated list of local IP numbers to a LF separated list
- ; of relayclients (for the control/relayclients file).
- (procedure P_getrelayclients _localIPs
- (
- (set _end (P_strchr _localIPs "\n"))
- (while (<> 0 _end)
- (
- (set _IP (substr _localIPs 0 _end))
- (set _localIPs (substr _localIPs (+ _end 1)))
- (set _relayclients (cat _relayclients _IP ":\n"))
- (set _end (P_strchr _localIPs "\n"))
- ))
- _relayclients
- ))
-
- ; Write control files
- (procedure P_writecontrols
- (
- (set _controldir (tackon @default-dest "control"))
- (makedir _controldir (infos))
-
- (textfile
- (dest (tackon _controldir "me"))
- (append #hostname) (append "\n")
- )
- (P_makeicon "controlfile" (tackon _controldir "me"))
-
- (textfile
- (dest (tackon _controldir "defaultdomain"))
- (append #defaultdomain) (append "\n")
- )
- (P_makeicon "controlfile" (tackon _controldir "defaultdomain"))
-
- (textfile
- (dest (tackon _controldir "plusdomain"))
- (append #plusdomain) (append "\n")
- )
- (P_makeicon "controlfile" (tackon _controldir "plusdomain"))
-
- (textfile
- (dest (tackon _controldir "locals"))
- (append #locals) (append "\n")
- )
- (P_makeicon "controlfile" (tackon _controldir "locals"))
-
- (textfile
- (dest (tackon _controldir "rcpthosts"))
- (include (tackon _controldir "locals"))
- )
- (P_makeicon "controlfile" (tackon _controldir "rcpthosts"))
-
- (if (<> #TCPstack "None")
- (
- (textfile
- (dest (tackon _controldir "relayclients"))
- (append #relayclients)
- )
- (P_makeicon "controlfile" (tackon _controldir "relayclients"))
- ))
- ))
-
- ; Create resolv.conf for DNS lookups.
- (procedure P_create_resolv_conf
- (
- (makedir (tackon @default-dest "etc") (infos))
- (set _resolv_conf (tackon @default-dest "etc/resolv.conf"))
-
- ; AmiTCP/IP and INET225 store this information in an ASCII file.
- (if (OR (= #TCPstack "AmiTCP/IP") (= #TCPstack "INET225"))
- (
- (if (exists "INET:db/resolv.conf" (noreq))
- (set _dns_conf "INET:db/resolv.conf")
- ;else
- (if (exists "AmiTCP:db/resolv.conf" (noreq))
- (set _dns_conf "AmiTCP:db/resolv.conf")
- ;else
- (if (exists "AmiTCP:db/netdb-myhost" (noreq))
- (set _dns_conf "AmiTCP:db/netdb-myhost")
- ;else
- (if (exists "AmiTCP:db/netdb" (noreq))
- (set _dns_conf "AmiTCP:db/netdb")
- ))))
-
- ; Create etc/resolv.conf
- (if _dns_conf
- (
- (run (cat "Edit FROM \"" _dns_conf "\""
- " TO ENV:InstallScriptTemp1 WITH instutils/nameserver.edit"
- " OPT P2W10240")
- (safe)
- )
- (rexx (cat "instutils/domainsearch.rexx " _dns_conf
- " ENV:InstallScriptTemp2")
- (safe)
- )
- (textfile (dest _resolv_conf)
- (include "ENV:InstallScriptTemp1")
- (include "ENV:InstallScriptTemp2")
- (append "\n")
- )
- (delete "ENV:InstallScriptTemp1" (safe))
- (delete "ENV:InstallScriptTemp2" (safe))
- (P_makeicon "controlfile" _resolv_conf)
- ))
- )
- ;else
- (if (= #TCPstack "Miami")
- (
- (P_run "SYS:RexxC/RX \"options RESULTS; address MIAMI.1 GETSETTINGSNAME; say result\"")
- (set _MiamiConfig (substr #output 0 (- (strlen #output) 1)))
- (run (cat "instutils/MiamiDNSFind <\"" _MiamiConfig
- "\" >\"" _resolv_conf "\""))
- (P_makeicon "controlfile" _resolv_conf)
- )))
- ))
-
- ; Create a drawer with 'conf_split' subdrawers in it
- (procedure P_makesplitdir _dir
- (
- (makedir _dir)
- (set _i 0)
- (while (< _i 23)
- (
- (makedir (tackon _dir (cat _i)))
- (set _i (+ _i 1))
- ))
- ))
-
- ; Create the various drawers used by the qmail system.
- (procedure P_createQmailDirs
- (
- (set _queue (tackon @default-dest "queue"))
- (set _alias (tackon @default-dest "alias"))
- (makedir _queue)
- (P_makesplitdir (tackon _queue "mess"))
- (P_makesplitdir (tackon _queue "info"))
- (P_makesplitdir (tackon _queue "local"))
- (P_makesplitdir (tackon _queue "remote"))
- (makedir (tackon _queue "pid"))
- (makedir (tackon _queue "intd"))
- (makedir (tackon _queue "todo"))
- (makedir (tackon _queue "bounce"))
- (makedir (tackon _queue "lock"))
- (textfile (dest (tackon _queue "lock/sendmutex")))
- (makedir _alias (infos))
- (textfile (dest (tackon _alias ".qmail-root")))
- (textfile (dest (tackon _alias ".qmail-postmaster")))
- (textfile (dest (tackon _alias ".qmail-mailer-daemon")))
- (P_makeicon "controlfile" (tackon _alias ".qmail-root"))
- (P_makeicon "controlfile" (tackon _alias ".qmail-postmaster"))
- (P_makeicon "controlfile" (tackon _alias ".qmail-mailer-daemon"))
- (set @execute-dir _alias)
- (set _currentdir (expandpath ""))
- (run (cat (tackon _currentdir "utils/minichown")
- " alias .qmail-root .qmail-postmaster .qmail-mailer-daemon"))
- (run (cat (tackon _currentdir "utils/minichgrp")
- " nofiles .qmail-root .qmail-postmaster .qmail-mailer-daemon"))
- (set @execute-dir "")
- (makedir (tackon @default-dest "users") (infos))
- ))
-
- ; Update the database of the TCP/IP stack.
- (procedure P_updateDatabase
- (
- ; Convert dirname to ixemul notation.
- (set _i (P_strchr @default-dest ":"))
- (set _qmail (cat "/" (substr @default-dest 0 _i) "/" (substr @default-dest (+ _i 1))))
-
- ; inetd conf
- (if (= #TCPstack "AmiTCP/IP")
- (textfile (dest "AmiTCP:db/inetd.conf")
- (include "AmiTCP:db/inetd.conf")
- (append (cat "smtp stream tcp nowait qmaild "
- (tackon @default-dest "bin/tcp-env") " tcp-env "
- (tackon @default-dest "bin/qmail-smtpd") "\n")
- )
- )
- ;else
- (if (= #TCPstack "INET225")
- (textfile (dest "INET:db/inetd.conf")
- (include "INET:db/inetd.conf")
- (append (cat "smtp stream tcp nowait qmaild "
- (tackon @default-dest "bin/tcp-env") " tcp-env "
- (tackon @default-dest "bin/qmail-smtpd") "\n")
- )
- )
- ;else
- (if (= #TCPstack "Miami")
- (
- (textfile (dest "ENVARC:MiamiChangeDB")
- (append (cat "ADD inetd smtp stream tcp nowait qmaild "
- (tackon @default-dest "bin/tcp-env") " tcp-env "
- (tackon @default-dest "bin/qmail-smtpd") "\n")
- )
- )
- (run "SYS:RexxC/RX \"address MIAMI.1 CHANGEDB\"")
- )
- )))
-
- ; Try to get inetd.conf reloaded if not done automatically
- (run "Break `Status COMMAND inetd` F")
-
- ; User/group databases
- (if (= #TCPstack "Miami")
- (
- (set _users "T:qmail users")
- (set _groups "T:qmail groups")
- )
- ;else
- (if (= #TCPstack "AmiTCP/IP")
- (
- (set _users "AmiTCP:db/passwd")
- (set _groups "AmiTCP:db/group")
- )
- ;else
- (if (= #TCPstack "INET225")
- (
- (set _users "INET:db/passwd")
- (set _groups "INET:db/group")
- )
- ;else
- (
- (if (exists "ETC:passwd" (noreq))
- (set _users "ETC:passwd")
- ;else
- (
- (set _users (tackon @default-dest "etc/passwd"))
- (makedir (tackon @default-dest "etc") (infos))
- (P_makeicon "controlfile" _users)
- )
- )
- (if (exists "ETC:group" (noreq))
- (set _groups "ETC:group")
- ;else
- (
- (set _groups (tackon @default-dest "etc/group"))
- (makedir (tackon @default-dest "etc") (infos))
- (P_makeicon "controlfile" _groups)
- )
- )
- ))))
-
- (textfile (dest _users)
- (include _users)
- (append (cat "alias|*|7790|2108||" (tackon @default-dest "alias") "|noshell\n"))
- (append (cat "qmaild|*|7791|2108||" _qmail "|noshell\n"))
- (append (cat "qmaill|*|7792|2108||" _qmail "|noshell\n"))
- (append (cat "qmailp|*|7793|2108||" _qmail "|noshell\n"))
- (append (cat "qmailq|*|7794|2107||" _qmail "|noshell\n"))
- (append (cat "qmailr|*|7795|2107||" _qmail "|noshell\n"))
- (append (cat "qmails|*|7796|2107||" _qmail "|noshell\n"))
- )
- (textfile (dest _groups)
- (include _groups)
- (append "qmail|*|2107|\n")
- (append "nofiles|*|2108|\n")
- )
-
- (if (= #TCPstack "Miami")
- (
- (set _msg (#msgMiamiDatabase _users _groups))
- (message _msg (all))
- (delete _users)
- (delete _groups)
- ))
- ))
-
- ; Copy the files
- (procedure P_copyFiles
- (
- (copyfiles
- (source "bin")
- (dest (tackon @default-dest "bin"))
- (all)
- (infos)
- )
- (copyfiles
- (source "utils")
- (dest (tackon @default-dest "utils"))
- (all)
- (infos)
- )
- (copyfiles
- (source "man")
- (dest (tackon @default-dest "man"))
- (all)
- (infos)
- )
- (copyfiles
- (source "docs")
- (dest (tackon @default-dest "docs"))
- (all)
- (infos)
- )
- ))
-
- ; Perform various fixes to the installed files.
- (procedure P_fixup
- (
- ; Fix the owner and attributes of bin/qmail-queue
- (set _currentdir (expandpath ""))
- (set @execute-dir (tackon @default-dest "bin"))
- (run (cat (tackon _currentdir "utils/minichown") " qmailq qmail-queue"))
- (run (cat (tackon _currentdir "utils/minichmod") " 82FAA qmail-queue"))
- (set @execute-dir "")
- ))
-
- ; Ask the user if qmail should be started now.
- (procedure P_askStartNow
- (askbool
- (prompt #askStartNow)
- (help "")
- (default 1)
- )
- )
-
- ; Create start/stop scripts and add a line to S:User-Startup
- (procedure P_createStartup
- (
- ; Convert dirname to ixemul notation.
- (set _ix_bin (tackon @default-dest "bin"))
- (set _i (P_strchr _ix_bin ":"))
- (set _ix_bin (cat "/" (substr _ix_bin 0 _i) "/" (substr _ix_bin (+ _i 1))))
-
- (textfile (dest (tackon @default-dest "Start qmail"))
- (append (cat "CD \"" @default-dest "\"\n"))
- (append "Path ADD bin utils\n")
- (append (cat "Set PATH \"" _ix_bin ":${PATH}\"\n"))
- (append "Run <NIL: >NIL: bin/qmail-start Mailbox bin/splogger qmail\n")
- )
- (P_makeicon "scriptfile" (tackon @default-dest "Start qmail"))
-
- (textfile (dest (tackon @default-dest "Stop qmail"))
- (append "Break <NIL: >NIL: `Status COMMAND qmail-send` C\n")
- (append "Break <NIL: >NIL: `Status COMMAND qmail-clean` C\n")
- (append "Break <NIL: >NIL: `Status COMMAND qmail-lspawn` C\n")
- (append "Break <NIL: >NIL: `Status COMMAND qmail-rspawn` C\n")
- (append "Break <NIL: >NIL: `Status COMMAND splogger` C\n")
- )
- (P_makeicon "scriptfile" (tackon @default-dest "Stop qmail"))
-
- (textfile (dest (tackon @default-dest "Flush queue"))
- (append "Break <NIL: >NIL: `Status COMMAND qmail-send` E\n")
- )
- (P_makeicon "scriptfile" (tackon @default-dest "Flush queue"))
-
- (textfile (dest (tackon @default-dest "Reload controlfiles"))
- (append "Break <NIL: >NIL: `Status COMMAND qmail-send` F\n")
- )
- (P_makeicon "scriptfile" (tackon @default-dest "Reload controlfiles"))
-
- (startup @app-name
- (prompt #askUserStartup)
- (help @startup-help)
- (confirm)
- (command (cat "Assign ADD ETC: \"" (tackon @default-dest "etc")
- "\"\n"))
- (command (cat "Run <NIL: >NIL: Execute \""
- (tackon @default-dest "Start qmail") "\" <NIL: >NIL:\n"))
- )
- ))
-
- ;----- Main programme. -----
-
- (P_coolIntro)
- (welcome)
- (P_doLocaleStrings)
-
- (set #TCPstack (P_guessTCPstack))
- (set #inplace (P_askInPlace))
- (set @default-dest (P_guessDestDir))
- (if #inplace
- (set @default-dest (expandpath ""))
- ;else
- (set @default-dest (P_askDestDir))
- )
- (if (NOT (exists @default-dest))
- (makedir @default-dest (infos))
- )
- (set @default-dest (expandpath @default-dest))
-
- (working #msgCreatingUsers)
- (P_updateDatabase)
-
- (P_createStartup)
-
- (set #hostname (P_gethostname))
-
- (if (<> #TCPstack "None")
- (
- (working #msgDNSsearch)
- (P_create_resolv_conf)
- (working #msgDNSlookup)
- (run (cat "Assign ADD ETC: \"" (tackon @default-dest "etc") "\""))
- (set #hostname (P_fqhostname #hostname))
- (set #localIPs (P_getlocalIPs))
- (set #locals (P_getlocals #localIPs #hostname))
- (set #relayclients (P_getrelayclients #localIPs))
- (run (cat "Assign REMOVE ETC: \"" (tackon @default-dest "etc") "\""))
- )
- ;else
- (set #locals #hostname)
- )
-
- (set #defaultdomain (P_getdomain #hostname))
- (set #plusdomain (P_getdomain #defaultdomain))
-
- (working #msgWritingControls)
- (P_writecontrols)
-
- (working #msgCreatingDirs)
- (P_createQmailDirs)
-
- (if (NOT #inplace)
- (P_copyFiles)
- )
-
- (P_fixup)
-
- (run (cat "Assign ADD ETC: \"" (tackon @default-dest "etc") "\"\n"))
-
- (if (P_askStartNow)
-
- (execute (cat "\"" (tackon @default-dest "Start qmail") "\""))
- )
-